package com.example.streamsqlpark.enums;

import java.io.Serializable;

/**
 * @author voloiono
 * @date 2024/4/17 10:01
 */
public enum ClusterState implements Serializable {
    CREATED(0),
    /** cluster started */
    STARTED(1),
    /** cluster stopped */
    STOPPED(2),

    /** cluster lost */
    LOST(3);

    private final Integer value;

    ClusterState(Integer value) {
        this.value = value;
    }

    public static ClusterState of(Integer value){
        for (ClusterState clusterState : values()) {
            if (clusterState.value.equals(value)){
                return clusterState;
            }
        }
        return null;
    }

    public Integer getValue() {
        return value;
    }
}
